<div class="row">
    <div class="col-md-12">
		<h1>Người dùng <small>Mở gian hàng</small></h1>
	</div>
    <div class="clearfix"></div>
</div>

<div class='row'>
    <div class="col-md-12 col-xs-12">        
        <?php if($registering) { ?>
        <div id="flg_message" class="alert alert-danger fade in">
            <div class="message-text">Đang cập nhật yêu cầu đăng kí</div>
        </div>
        <?php } else { ?>
        <div id="flg_message" class="alert fade in hidden">
            <button type="button" class="close">×</button>
            <h4 class="message-title"></h4>
            <div class="message-text"></div>
        </div>
        <?php } ?>
    </div>    
	<div class="clearfix"></div>
</div>

<?php if(!$registering) { ?>
<form class="form-horizontal" role="form" method="post" action="<?php echo page_url(SHOP_SLUG.'/dang-ki/do'); ?>">
<?php } else { ?>
<form class="form-horizontal" role="form" method="post" action="<?php echo page_url(SHOP_SLUG.'/dang-ki/do'); ?>">
<?php } ?>
    <div class="form-group">
    	<label for="shop-title" class="col-md-2 control-label"><span class="text-danger">*</span> Tên gian hàng</label>
        <div class="col-md-4">
            <input name="shop[title]" type="text" class="form-control auto-slug" id="shop-title" follow-ctr='#shop-slug' value="<?php echo $info->getTitle(); ?>" />
        </div>
    </div>
    <div class="form-group">
    	<label for="shop-slug" class="col-md-2 control-label"><span class="text-danger">*</span> Đường dẫn</label>
        <div class="col-md-4">
            <input name="shop[slug]" type="text" class="form-control" id="shop-slug" value="<?php echo $info->getSlug(); ?>" />
        </div>
    </div>
    <div class="form-group">
        <label for="shop-homepage" class="col-md-2 control-label">Website</label>
        <div class="col-md-4">
            <input name="shop[home_page]" type="text" class="form-control" id="shop-homepage" value="<?php echo $info->getHomePage(); ?>" />
        </div>
    </div>
    <?php
        //get all theme
        $themePath = FCPATH.'application/views/shop-themes/';
        $aShopThemeInfo = scandir($themePath);
        foreach($aShopThemeInfo as $index=>$folder) {
            if(!is_dir($themePath . $folder) || $folder=='.' || $folder=='..'){
                unset($aShopThemeInfo[$index]);
            }
        }
    ?>
    <div class="form-group">
        <label for="shop-template" class="col-md-2 control-label">Giao diện</label>
        <div class="col-md-4">
            <select name="shop_setting[template]" class="form-control" id="shop-template">
            <?php foreach($aShopThemeInfo as $folder) { ?>
                <?php $selected = $shop->template==$folder?"selected='selected'":""; ?>
                <option value="<?php echo $folder; ?>" <?php echo $selected?>><?php echo $folder; ?></option>
            <?php } ?>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="shop-details" class="col-md-2 control-label">Chi tiết</label>
        <div class="col-md-10">
            <textarea name="shop_details" class="ckeditor" id="shop-details" rows="5"><?php echo $info->getDetails(); ?></textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="shop-payment-method" class="col-md-2 control-label"><span class="text-danger">*</span> Phương thức thanh toán</label>
        <div class="col-md-10">
            <textarea name="shop_payment_method" class="ckeditor" id="shop-payment-method"><?php echo $info->getPaymentMethod(); ?></textarea>
        </div>
    </div>
    <?php if(!$registering) { ?>
    <div class="form-group">
        <div class="col-md-4 col-md-offset-2">
            <button type="button" class="btn btn-success btn-submit-update">
                <i class="glyphicon glyphicon-ok"></i>&nbsp;Lưu&nbsp;
            </button>
        </div>
    </div>
    <?php } ?>
</form>

<script type="text/javascript">
<?php if($registering) { ?>
    $(document).ready(function(){
        $('textarea, input').attr('disabled', true);
    });
<?php } ?>
</script>